<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
  <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
  <style type="text/css">
  /* tooltip */
  #tooltip{
    position:absolute;
    border:1px solid #ccc;
    background:#333;
    padding:2px;
    display:none;
    color:#fff;
  }
  </style>
</head>
<body style="padding:10px;">
  <div class="tplay-body-div" id="layerDemo">
    <!--<div class="layui-tab">-->
    <!--  <ul class="layui-tab-title">-->
    <!--    <li class="layui-this">补助补贴发放</li>-->
        <!-- <li><a href="{:url('admin/hqjiesuan/hqjiesuan_add')}" class="a_menu">拆迁费用结算</a></li> -->
    <!--  </ul>-->
    <!--</div> -->
      <!-- <form class="layui-form serch" action="{:url('admin/population/index')}" method="post">
        <div class="layui-form-item" style="float: left;">
          <div class="layui-input-inline">
            <input type="text" name="keywords" lay-verify="title" autocomplete="off" placeholder="请输入关键词" class="layui-input layui-btn-sm">
          </div>
          <button class="layui-btn layui-btn-danger layui-btn-sm chaxui" lay-submit="" lay-filter="serch">立即查询</button>
        </div>
      </form>  -->
    <table class="layui-table" lay-size="lg">
      <thead>
        <tr>
          <th>序号</th>
          <th>户主</th>
          <th>今年金额</th>
          <th>上年金额</th>
          <th>往年金额</th>
          <th>补助补贴总计</th>
          <?php if(!in_array($admin_cate_id,$operation)){ ?>
          <th>操作</th>
          <?php } ?>
        </tr> 
      </thead>
      <tbody>
        {volist name="list" id="vo"}
        <tr>
          <td>{$key+1}</td>
          <td><a href="{:url('admin/cqhperson/info',['id'=>$vo.id])}" style="color:#4e6ef2">{$vo.name}</a></td>
          <td><a href="{:url('admin/subsidy/years',['id'=>$vo.id])}">{$vo.nowSum}</a></td>
          <td><a href="{:url('admin/subsidy/lastyrs',['id'=>$vo.id])}">{$vo.quSum}</a></td>
          <td><a href="{:url('admin/subsidy/formeryrs',['id'=>$vo.id])}">{$vo.otherSum}</a></td>
          <td>{$vo.sum}</td>
          <?php if(!in_array($admin_cate_id,$operation)){ ?>
          <td>
              <div class="layui-btn-group">
                <a href="{:url('admin/subsidy/info',['id'=>$vo.id])}" id="{$vo.id}" class="layui-btn layui-btn-xs layui-btn-primary" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                <!--<a href="{:url('admin/subsidy/subsidy_add',['id'=>$vo.id])}" id="{$vo.id}" class="layui-btn layui-btn-xs layui-btn-primary" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>-->

                <!-- <button data-method="notice" data-id="{$vo.id}" class="layui-btn">示范一个公告层</button> -->
                <!-- <a href="{:url('admin/subsidy/subsidy_add',['id'=>$vo.id])}" class="layui-btn layui-btn-xs a_menu" id="{$vo.id}" style="margin-right: 0;font-size:12px;">修改</a> -->
                <!-- <a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-primary delete" id="{$vo.id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a> -->
              </div>
          </td>
          <?php } ?>
        </tr>
        {/volist}
      </tbody>
    </table>
    <div style="padding:0 20px;"></div> 
    {include file="public/foot"}
  </div>

  <!-- <script>
    layui.use('layer', function(){ //独立版的layer无需执行这一句
      var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
      //触发事件
      var active = {
          notice: function(){
            //示范一个公告层
            layer.open({
              type: 1
              ,title: false //不显示标题栏
              ,closeBtn: false
              ,area: '1000px;'
              ,shade: 0.8
              ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
              ,btn: ['确认提交', '取消']
              ,btnAlign: 'c'
              ,moveType: 1 //拖拽模式，0或者1
              ,content: '<div style="padding: 50px; line-height: 22px; font-weight: 500; id="number">\
              <form class="layui-form" id="admin">\
              <input type="hidden" name="uid" value="" />\
              <table border="1" cellspacing="0" width="100%" height="100%">\
                <tr>\
                  <td width="19%" rowspan="2" valign="center" style="text-align:center" >\
                    <h2><strong>项目</strong></h2></td>\
                </tr>\
                <tr >\
                  <td width="14%" valign="center" style="text-align:center"><h2><strong>金额</strong></h2></td>\</td>\
                </tr>\
                <tr >\
                  <td valign="center" ><p align="center" ><strong>取暖费</strong><strong> </strong></p></td>\
                  <td valign="center" ><input name="qunuanfei" lay-verify="required" value="" autocomplete="off" class="layui-input" type="number"></td>\
                </tr>\
                <tr >\
                  <td valign="center" ><p align="center" ><strong>租房费</strong><strong> </strong></p></td>\
                  <td valign="center" ><input name="zufangfei" lay-verify="required" value="" autocomplete="off" class="layui-input" type="number"></td>\
                </tr>\
                <tr >\
                  <td valign="center" ><p align="center" ><strong>生活补助</strong><strong> </strong></p></td>\
                  <td valign="center" ><input name="shenghuobu" lay-verify="required" value="" autocomplete="off" class="layui-input" type="number"></td>\
                </tr>\
                <tr >\
                  <td valign="center" ><p align="center" ><strong>搬家补助</strong><strong> </strong></p></td>\
                  <td valign="center" ><input name="banjiabu" lay-verify="required" value="" autocomplete="off" class="layui-input" type="number"></td>\
                </tr>\
                <tr >\
                  <td valign="center" ><p align="center" ><strong>其它1</strong><strong> </strong></p></td>\
                  <td valign="center" ><input name="qita1" lay-verify="required" value="" autocomplete="off" class="layui-input" type="number"></td>\
                </tr>\
              </table>\
              </form>\
              </div>'
              ,success: function(layero){
                var btn = layero.find('.layui-layer-btn');
                btn.find('.layui-layer-btn0').click(function(){
                    layui.use(['layer', 'form'], function() {
                      var layer = layui.layer,
                          $ = layui.jquery,
                          form = layui.form;
                      // $(window).on('load', function() {
                          // form.on('submit(admin)', function(data) {
                              $.ajax({
                                  url:"{:url('admin/subsidy/subsidy_add')}",
                                  data:$('#admin').serialize(),
                                  type:'post',
                                  async: false,
                                  success:function(res) {
                                    if(res.code == 1) {
                                        layer.alert('提交成功！',{icon:6},window.location.href = "{:url('admin/subsidy/subsidy')}");
                                    }else {
                                        layer.msg(res.msg);
                                    }
                                  }
                              })
                              return false;
                          // });
                      // });
                  });
                });
              }
            });
          }
      }
      $('#layerDemo .layui-btn').on('click', function(){
        var othis = $(this), method = othis.data('method');
        active[method] ? active[method].call(this, othis) : '';

      });
    })
  </script> -->
  <script>
    layui.use('layer', function() {
        var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
        var layer = layui.layer;
        $('.a_menu').click(function() {
            var url = $(this).attr('href');
            var a = 0;
            $.ajax({
                url: url,
                async: false,
                success: function(res) {
                    if (res.code == 0) {
                        layer.msg(res.msg);
                        a = 1;
                    }
                }
            })
            if (a === 0) {
                layer.open({
                    type: 2,
                    content: [url],
                    area: ['700px', '500px'],
                    scrollbar:true
                });
            }
            return false;
        })
    });
  </script>
  <script type="text/javascript">
    $('.delete').click(function(){
      var id = $(this).attr('id');
      layer.confirm('确定要删除?', function(index) {
        $.ajax({
          url:"{:url('admin/subsidy/delete')}",
          data:{id:id},
          success:function(res) {
            layer.msg(res.msg);
            if(res.code == 1) {
                layer.alert('删除成功！',{icon:2});
                location.reload();
            }
          }
        })
      })
    })
    </script>
    <script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
          elem: '#test1'
        });
    })
    </script>
</body>
</html>